﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TelerikAcademyOopProject
{
    public abstract class Item
    {

        /*==========================================*/
        //              Item FIELDS
        /*==========================================*/

        private string            itemId;
        private string            itemName;
        private Spred             itemPrice;
        private int               itemCount;

        /*==========================================*/
        //              Item PROPERTIES
        /*==========================================*/

        public string ItemId
        {
            get { return itemId; }
            set { itemId = value; }
        }

        public string ItemName
        {
            get { return itemName; }
            set { itemName = value; }
        }

        public Spred ItemPrice
        {
            get { return itemPrice; }
            set { itemPrice = value; }
        }

        public int ItemCount
        {
            get { return itemCount; }
            set { itemCount = value; }
        }

        /*==========================================*/
        //              Item CONSTRUCTOR
        /*==========================================*/

        //public Item(string id,string name, Spred ip, int ic)
        //{
        //    this.ItemId         = id;
        //    this.ItemName       = name;
        //    this.ItemPrice      = ip;
        //    this.ItemCount      = ic;
        //}

        /*==========================================*/
        //              Item METHODS
        /*==========================================*/

        /* ABSTRACT METHODS */ 
        public abstract string GetItemName();

        public void setItemPropertys(string id, string name, Spred ip, int ic)
        {
            this.ItemId = id;
            this.ItemName = name;
            this.ItemPrice = ip;
            this.ItemCount = ic;
        }

        /* OVERRIDEN METHODS */
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            
            sb.AppendFormat("ID : {0,-5} Name : {1,-10} Count : {2,-5} Price : {3,3}", this.ItemId, this.ItemName,this.ItemCount,this.ItemPrice.PurchasePrice);
            
            return sb.ToString();
        }

    }
}
